UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '10swFYFsJVNdsfALkREMVzc5CF8JoHRjBA1IOKh8gE4=' 
WHERE 
  key_id = 'a4cd1fc954b20f1f469f8dfcaedcfd4d040bb90118dc315fdf98818ed979a77d' 
  AND (
    token = '10swFYFsJVNdsfALkREMVzc5CF8JoHRjBA1IOKh8gE4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032