UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Oss61aWgZDLkzLU3gAGvRcxBf/ZNQR9/nex3Gup9F90=' 
WHERE 
  key_id = 'a97a2a0c981291a6101966e10fb9b4ae25457a55e3c8d889d9cd3532bf7b7309' 
  AND (
    token = 'Oss61aWgZDLkzLU3gAGvRcxBf/ZNQR9/nex3Gup9F90=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026