UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'b43enbUkbNbkmsgdxt5XsO8gz9wZYwSpc/Q1cG05S9k=' 
WHERE 
  key_id = '8ba20d1bc9d61f16a76b2650050ae3578bb4dd315327c794daf29f110d2019cf' 
  AND (
    token = 'b43enbUkbNbkmsgdxt5XsO8gz9wZYwSpc/Q1cG05S9k=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034