UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'mEUOlgn1VPWNnHEWddqne8O2qP6PUiS82het+xhVkmc=' 
WHERE 
  key_id = 'f6e04e2aaafbe9fb66d05507bca86df9c533a1a3e4a6fc215ba73d43281a09d4' 
  AND (
    token = 'mEUOlgn1VPWNnHEWddqne8O2qP6PUiS82het+xhVkmc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034