UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vY7L0QBcn0xNYJMZZmEYAwDXrkXIffzEiCyqHShSFNM=' 
WHERE 
  key_id = '46d3a031f67243bd67808c46650fd14523dcf23007a47e3793d7b8eeaafa212e' 
  AND (
    token = 'vY7L0QBcn0xNYJMZZmEYAwDXrkXIffzEiCyqHShSFNM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030