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

Query time 0.00022