UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'aocavino4hmj+F7ebmGSn/MqUMXRaLtHUvim2y/QHwc=' 
WHERE 
  key_id = 'fec5da0e8146125e349a1f87679c6fa539e135eaac0672e4b8b13ee3f3433d6a' 
  AND (
    token = 'aocavino4hmj+F7ebmGSn/MqUMXRaLtHUvim2y/QHwc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042