UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'QApyMjYr11LDmGwq6Jc+V4H9kfJZIF2wBHQdI9UUC2M=' 
WHERE 
  key_id = '4119d5f1e4e35b989f5d56fbe63d807145887762502ccdc929cb91892e28e6da' 
  AND (
    token = 'QApyMjYr11LDmGwq6Jc+V4H9kfJZIF2wBHQdI9UUC2M=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036