UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'jLHX/pfEoNyWL0UQaur93+D+HUGJuUt7BbCNWoFlF4w=' 
WHERE 
  key_id = '613052bd5a9f9051a6922f99acc2e64d15099a287300118194b2ef11dcc426e8' 
  AND (
    token = 'jLHX/pfEoNyWL0UQaur93+D+HUGJuUt7BbCNWoFlF4w=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031