UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'FMcjLeI3ZyGE27vWS2zEi4t36noqR6/Pv06pzi0ramE=' 
WHERE 
  key_id = '71580197916fdbf32f45a5caabbaa18228b44689fa3e466103602be188366882' 
  AND (
    token = 'FMcjLeI3ZyGE27vWS2zEi4t36noqR6/Pv06pzi0ramE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021