UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'mwMhht8jcT0l1YW7Ms9ggTmE9TE7cDUOhT9RyrTSnH8=' 
WHERE 
  key_id = 'fd3e2508dc3d1c7e961543a0dd7428afc52733d4b52374dd701dfa61a5cba69f' 
  AND (
    token = 'mwMhht8jcT0l1YW7Ms9ggTmE9TE7cDUOhT9RyrTSnH8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030