UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'PSCBM9AC9JMrzVcVmqwqWjZoqcAlwLyVCt5Qk7zRTo8=' 
WHERE 
  key_id = '034375cc957b5265ec28889ebe3cb7dac06c48a87623f3bf6eb53e0413887edf' 
  AND (
    token = 'PSCBM9AC9JMrzVcVmqwqWjZoqcAlwLyVCt5Qk7zRTo8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041