UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'yIUshAa8VM5pU0FFDKYfRsLUJ6AxHubUxISm9Ht1XFE=' 
WHERE 
  key_id = '6b90f3fb4bcd40ead0ce7a9f3dcd01eab95e38e6ae27972f6fc2732a9aef4058' 
  AND (
    token = 'yIUshAa8VM5pU0FFDKYfRsLUJ6AxHubUxISm9Ht1XFE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034