UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5IjF6f47ikvtPaW9pu7MHEUNvxb57C25lO5/hjbt9vA=' 
WHERE 
  key_id = '50b180a36902d688670316c9edeaf34249ea9fb60e5f46b7c3e3c5a026abb88d' 
  AND (
    token = '5IjF6f47ikvtPaW9pu7MHEUNvxb57C25lO5/hjbt9vA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027