UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+4llP3i67ipfC5BN9IlA1s4+DwmfRGmm+k8qP8HXV1w=' 
WHERE 
  key_id = '66f8876e4ccc6f91d794178f97696ecc13fe8127f8ef2951bf977df0b3ccd37b' 
  AND (
    token = '+4llP3i67ipfC5BN9IlA1s4+DwmfRGmm+k8qP8HXV1w=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025