UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4lxRL30+BcurcjUkr3SKPmWn/w/z+mpLsJYGwfnKbfo=' 
WHERE 
  key_id = '5ebfcb5047349abf2580830492d7f4dce2509cd4b0f9bc7371f887c0b10d822a' 
  AND (
    token = '4lxRL30+BcurcjUkr3SKPmWn/w/z+mpLsJYGwfnKbfo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00060