UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'uvIqJK9zt31wb3et11DX/IEP92LM5JC6xaFTtND4zuA=' 
WHERE 
  key_id = '810555bc51bfc854a93496ba41da4b3e881140000a3102873504e89e91cb661c' 
  AND (
    token = 'uvIqJK9zt31wb3et11DX/IEP92LM5JC6xaFTtND4zuA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00015