UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'b7MN0HJCiJm+fOCohKVRgYMfg4illshif5aJFWAptjY=' 
WHERE 
  key_id = 'e7e76a1b6c167b8337368ca340a026c3d14b8caefb33d5d86d62b8f332bfaf73' 
  AND (
    token = 'b7MN0HJCiJm+fOCohKVRgYMfg4illshif5aJFWAptjY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034