UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'YHogwizIXPqxZajzeysAGBBysE08t91rRZBtCxuM898=' 
WHERE 
  key_id = 'd81d03fc2944fb4e56f4f28d93555e9aa16ddc37ae40b894d59b78b7f34d354f' 
  AND (
    token = 'YHogwizIXPqxZajzeysAGBBysE08t91rRZBtCxuM898=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045