UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'FTlc+dDCIUbYO0/sjWhKjZC/ojnGiV5TFsYtzRWxMJQ=' 
WHERE 
  key_id = '7e55860ad982de155695b5780adb7ffcc5d994e3c0f70da743e85f2a8b403dec' 
  AND (
    token = 'FTlc+dDCIUbYO0/sjWhKjZC/ojnGiV5TFsYtzRWxMJQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036