UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'l+Xkx/tLENAFfkUuGU1vcqouMd9hJDr9dowseskrW8k=' 
WHERE 
  key_id = '837bf2ee82c107a8eb2e5f0653d5f7e176960afd0b6a63abdb0832f09bdfce5f' 
  AND (
    token = 'l+Xkx/tLENAFfkUuGU1vcqouMd9hJDr9dowseskrW8k=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00046