UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'nf3gi0fJKcPZx7CxNT3xZbhoLJWh6IKX6i2ccu01BUI=' 
WHERE 
  key_id = '59c0b3701db334b7ebefce523830898eb6f1632cceea53e4b7347fdcf1ff19f4' 
  AND (
    token = 'nf3gi0fJKcPZx7CxNT3xZbhoLJWh6IKX6i2ccu01BUI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00066