UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/Aj70RZD3d73+HgAOpyt7H3gbC7T6s1qY/KV6mEreLk=' 
WHERE 
  key_id = 'f4703cdfc05f0367236c172f714773369063cb7408369bb3871819bff81aefc4' 
  AND (
    token = '/Aj70RZD3d73+HgAOpyt7H3gbC7T6s1qY/KV6mEreLk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00049