UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'kwXzBKjFpeSGAniuqnmrzxM/aETzjQUInHdWrVqhV2U=' 
WHERE 
  key_id = 'dbad01131bd8804b4e6922f9856330a1c8b07805171589bc4c8c1d3ccfd032f6' 
  AND (
    token = 'kwXzBKjFpeSGAniuqnmrzxM/aETzjQUInHdWrVqhV2U=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030