UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'wR9fK9zQmeQ2CEK1N1PgpOsQZmBkXQwQKPkWRai4y78=' 
WHERE 
  key_id = '87dd88c218fd52c8a6d1da573226bccb1dffa3d48836b4e837e46a773cf2e083' 
  AND (
    token = 'wR9fK9zQmeQ2CEK1N1PgpOsQZmBkXQwQKPkWRai4y78=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032