UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'O74UlZLkqHWevWC2o4MvX41l0zUjuKSYXNfxGXe/Kz4=' 
WHERE 
  key_id = 'f77b59b35c3bc1dc5a89e7adff5add11db7be4e43614ea40d1750eff0bd6f99e' 
  AND (
    token = 'O74UlZLkqHWevWC2o4MvX41l0zUjuKSYXNfxGXe/Kz4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045