UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'FgfoMaw9jJlcSV1HMGXki5F3ltmHEJWyxbxz2Jl8fiI=' 
WHERE 
  key_id = '803b0fa19214789105120a3e40a490c922c46ede695e790d9eada46e74858155' 
  AND (
    token = 'FgfoMaw9jJlcSV1HMGXki5F3ltmHEJWyxbxz2Jl8fiI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040