UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'EB9PRvkDvZicGLpS9HttJs5LqMAQqSIAi3Kba8jdE9c=' 
WHERE 
  key_id = '6c1b990a411a3a396a57acc9da703f7ddca920e5b12db3cb4de4871adad20ae2' 
  AND (
    token = 'EB9PRvkDvZicGLpS9HttJs5LqMAQqSIAi3Kba8jdE9c=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00046