UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Mn0GEf5RoK7Ywjts6QJLXKMl2+xJ/wzkZihhrpgrCGI=' 
WHERE 
  key_id = 'c5e3475781e6d90da197d41e06bb3af29bf7eb05f43dd113057494b7c40db632' 
  AND (
    token = 'Mn0GEf5RoK7Ywjts6QJLXKMl2+xJ/wzkZihhrpgrCGI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026