UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'kX3E9hTOFRTmbaSUJzl/ECrv4hO3YudnqhFWRMfb4qw=' 
WHERE 
  key_id = '96737446e76654f1059b255b3d2f372cf4ef2eafc69084f30f25e9a267f1cd37' 
  AND (
    token = 'kX3E9hTOFRTmbaSUJzl/ECrv4hO3YudnqhFWRMfb4qw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00046